/*
 * @Author: ljkt
 * @Version: 2.0
 * @Date: 2022-05-16 11:06:33
 * @LastEditors: ljkt
 * @LastEditTime: 2025-02-27 15:44:25
 * @Description:
 */
#ifndef _HAL_TIMEX_H_
#define _HAL_TIMEX_H_

#if defined(EN_TIMER0) || defined(EN_TIMER1) || defined(EN_TIMER2) || defined(EN_TIMER3)

enum
{
#ifdef EN_TIMER0
    e_HAL_TIMER0,
#endif
#ifdef EN_TIMER1
    e_HAL_TIMER1,
#endif
#ifdef EN_TIMER2
    e_HAL_TIMER2,
#endif
#ifdef EN_TIMER3
    e_HAL_TIMER3,
#endif
    e_HAL_TIMER_MAX,
};

typedef struct
{
    unsigned char index;
    unsigned long f;
} s_tmrx_config_t;
typedef struct
{
    unsigned short reload;
} s_hal_tmrx_t;
extern s_hal_tmrx_t gHalTmrx[e_HAL_TIMER_MAX];
void Hal_Tmrx_Start(s_tmrx_config_t *config);
void Hal_Tmrx_Stop(s_tmrx_config_t *config);
void Hal_Tmrx_Init(s_tmrx_config_t *config);

#ifdef EN_TIMER0
void Hal_Tmr0_IF_Clr_Isr(void);
#endif
#ifdef EN_TIMER1
void Hal_Tmr1_IF_Clr_Isr(void);
#endif
#ifdef EN_TIMER2
void Hal_Tmr2_IF_Clr_Isr(void);
#endif
#ifdef EN_TIMER3
void Hal_Tmr3_IF_Clr_Isr(void);
#endif
#endif
#endif
